<%@page contentType="text/html;charset=UTF-8" %><%@page import="java.util.LinkedList" %><%@page import="be.destin.skos.core.SkosManager" %><%@page import="be.destin.skos.core.Concept" %><%@page import="be.destin.skos.core.Application" %><%@page import="be.destin.skos.html.SkosHtmlManager" %><%@page import="be.destin.skos.core.SchemeInterface" %><%@page import="be.destin.skos.view.SkosView" %><%@page import="be.destin.skos.view.SkosViewType" %><%@page import="be.destin.skos.view.ViewConcept" %><%@page import="be.destin.skos.view.SkosViewManager" %><%@page import="be.destin.memolog.UsageMode" %><%@page import="be.destin.memolog.UsageLogger" %><%@page import="be.destin.memo.Log" %><%@page import="be.destin.memo.TagDef" %><%@page import="be.destin.memo.Tagged" %><%@page import="java.util.List" %><%@page import="java.util.LinkedHashMap" %><%
	SkosHtmlManager skosHtmlManager = SkosHtmlManager.getAskosiSessionInstance(request);
	SkosManager skosManager = skosHtmlManager.getSkosManager();
	String language = skosHtmlManager.getLanguage();
	SchemeInterface aScheme = skosManager.getApplications();
	SkosView appView = null;
	LinkedList<ViewConcept> appConcepts = null;
	LinkedHashMap<String,Application> codeApps = new LinkedHashMap<String,Application>(); 
	if (aScheme != null) {
		SkosViewType viewType = SkosViewType.ALFA;
		appView = SkosViewManager.openView(skosHtmlManager,aScheme.getAbout(), viewType, language,false, null);
		appConcepts = SkosViewManager.getConcepts(appView);
		for (Concept aConcept : aScheme.getAllConcepts()) {
			if (aConcept instanceof Application) {
				Application anApp = (Application)aConcept;
				String atomURL = anApp.getAtomURL();
				if (atomURL != null && !atomURL.isEmpty()) {
					codeApps.put(anApp.getAbout(),anApp);
				}
			}
		}
	}
	aScheme = skosManager.getMetaScheme();
	LinkedList<ViewConcept> schemesConcepts = null;
	SkosView schemesView = null;
	if (aScheme != null) {
		SkosViewType viewType = SkosViewType.ALFA;
		schemesView = SkosViewManager.openView(skosHtmlManager,aScheme.getAbout(), viewType, language,false, null);
		schemesConcepts = SkosViewManager.getConcepts(schemesView);
	}
%><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>GLISP RSS Browser</title>
	<link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/css/jqueryui.css" />
	<script type="text/javascript" src="js/jquery-1.7.2.js"></script>
	<script type="text/javascript" src="js/jquery-ui-1.8.23.custom.js"></script>
	<script src="js/jsuri-1.1.1.min.js"></script>
	<!-- link rel="stylesheet" href="http://jqueryui.com/demos/demos.css" -->
    <script type="text/javascript" src="js/binding-atom.js"></script>
    <script type="text/javascript" src="js/atomModel.js"></script>
    <script type="text/javascript" src="metadatajson.jsp"></script>
    <script type="text/javascript" src="js/underscore-1.1.7.js"></script>
    <script type="text/javascript" src="js/facetedsearch.js"></script>
	<link rel="stylesheet" href="css/glisp-feed.css">
</head>
  <body style="position:relative">
<%String pageID = "TOC";%><%@include file="basket.jnc"%> 
  		<script type="text/javascript">
  			var apps = appNames.skosView.narrower;
  			var appsDiv = $('#apps');
  			for (var i=0; i < apps.length; i++) {
  				appsDiv.append('<a href="'+apps[i].url+'" title="'+apps[i].prefLabel+'">'+(apps[i].icon?'<img border="0" src="'+apps[i].icon+'"/>':'?')+'</a>&nbsp;')
  			}
  		</script>
		<div style="text-align:center; padding:12px; margin:2px;"><span class="ui-widget-header" style="display:in-line; border: solid grey 1px; padding:9px; margin:1px;"><big><b>GLISP</b></big> : <i>Glide &amp; Spot information!</i><img src="image/32x32/freelance.png" border="0"/></span></div>



    <p><a href="javascript:dumpFeed()">source</a></p>
	    <form action="glispbrowse.jsp" method="GET">
		<table border="0" cellspacing="4px" cellpadding="4px" class="ui-widget-header" style="border: solid black 1px;">
		<tr><th>Service:</th><td><select name="service"><% for (Application aVConcept: codeApps.values()) { %><option value="<%=aVConcept.getAbout()%>"><%=aVConcept.getPrefLabel(language,false)%></option><% } %></select></td></tr>
		<tr><th>Query:</th><td><input name="query" size="80"/></td></tr>
		<tr><th>ConceptScheme:</th><td><select name="collection"><option value='-'>(any)</option><% for (ViewConcept aVConcept: schemesConcepts) { %><option value="<%=aVConcept.getAbout()%>"><%=aVConcept.getPrefLabel()%></option><% } %></select></td></tr>
		<tr><th colspan="2"><input type="submit" name="button" value="GO"/></th></tr>
		</table>
		</form>
  </body>
</html>
